<!DOCTYPE html>
<?php
//Datenbank einstellungen laden
include("conf/conf.php");
$dbConf = new Conf();
$databaseURL = $dbConf->get_databaseURL();
$databaseUName = $dbConf->get_databaseUName();
$databasePWord = $dbConf->get_databasePWord();
$databaseName = $dbConf->get_databaseName();
?>
<html> 
    <head> 
        <title>TU Braunschweig mobil</title> 
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width; initial-scale=1; maximum-scale=1; user-scalable=no;">
        <link rel="shortcut icon" href="themes/images/tubs_favicon.png" />
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
        <link rel="stylesheet" href="themes/TU-BS.css" />
        <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
        <script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
    </head> 

    <body> 
        <div data-role="page" id="klausurtermine">
            <div data-role="header">
                <div class="ui-grid-b">
                    <div class="ui-block-a">
                        <div id="header">
                            <a href="index-mobile.php" data-ajax="false"><img src="themes/images/siegel.png" width="71px" height="74px" alt="TU Siegel"></a>
                        </div>
                    </div>
                    <div class="ui-block-b">
                        <div id="crumb">
                            <a href="termine.php" data-ajax="false"><img src="themes/images/83-calendar@2xw.png" height="36px" width="48px"></a>
                        </div>
                    </div>
                    <div class="ui-block-c">
                        <div id="crumb">
                            <img src="themes/images/187-pencil@2xw.png" height="36px" width="48px">
                        </div>
                    </div>
                </div>
            <div style="clear: both"></div>
        </div>
        <div data-role="content" data-theme="b">
            <ul data-role="listview" data-filter="true" data-filter-placeholder="Name des Studiengangs..." data-inset="true" data-filter-theme="d">
                <?php
                $connection = mysql_connect($databaseURL, $databaseUName, $databasePWord)
                        or die("Error while connecting to localhost");
                $db = mysql_select_db($databaseName, $connection)
                        or die("Error while connecting to database");

                $sql = "SELECT * FROM klausurtermine ORDER BY studiengang, art";

                $res = mysql_query($sql) or die("Error while connecting to database");

                while ($row = mysql_fetch_object($res)) {
                    echo "<li><a href='" . $row->link . "' rel='external'>" . utf8_encode($row->studiengang) . " " . $row->art . "</a></li>";
                }
                ?>
            </ul>
        </div>
    </div>
</body>
</html>